stack: Redraw last_visible_surface if child allocation changes
authorTimm Bäder <mail@baedert.org>
Fri, 28 Oct 2016 10:51:03 +0000 (12:51 +0200)
committerTimm Bäder <mail@baedert.org>
Mon, 31 Oct 2016 18:29:36 +0000 (19:29 +0100)
So the widget is properly aligned.

gtk/gtkstack.c

index 7b4af979149aa18e4acb65e6de7efcfb20af840f..fd23f8a40396ecfde7a27c592f5654b4078d6ee3 100644 (file)
@@ -2239,6 +2239,13 @@ gtk_stack_allocate (GtkCssGadget        *gadget,
       child_allocation.height = MAX (min, allocation->height);
 
       gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);
+
+      if (!gdk_rectangle_equal (&priv->last_visible_surface_allocation,
+                                &child_allocation))
+        {
+          cairo_surface_destroy (priv->last_visible_surface);
+          priv->last_visible_surface = NULL;
+        }
     }
 
   child_allocation.width = allocation->width;